/**
 * Created by zhangxiaoyu on 16/12/01.
 */
var hyt_route = angular.module("hyt.route", []);

hyt_route.config(["$stateProvider", "$urlRouterProvider","$ionicConfigProvider", function ($stateProvider, $urlRouterProvider,$ionicConfigProvider) {
    $ionicConfigProvider.platform.ios.tabs.style('standard');
    $ionicConfigProvider.platform.ios.tabs.position('bottom');
    $ionicConfigProvider.platform.android.tabs.style('standard');
    $ionicConfigProvider.platform.android.tabs.position('standard');

    $ionicConfigProvider.platform.ios.navBar.alignTitle('center');
    $ionicConfigProvider.platform.android.navBar.alignTitle('center');

    $ionicConfigProvider.platform.ios.backButton.previousTitleText('').icon('ion-ios-arrow-thin-left');
    $ionicConfigProvider.platform.android.backButton.previousTitleText('').icon('ion-android-arrow-back');

    $ionicConfigProvider.platform.ios.views.transition('ios');
    $ionicConfigProvider.platform.android.views.transition('android');
    $stateProvider
      .state('tab', {
        url: '/tab',
        abstract: true,
        templateUrl: 'templates/tabs.html'
      })

      //工具
      .state('tab.tool', {
        url: '/tool',
        views: {
          'tab-tool': {
            templateUrl: 'templates/tab-tool/tools.html',
            controller:'toolsCtrl'
          }
        }
      })

      //工作台
      .state('tab.workbench', {
        cache:false,
        url: '/workbench',
        views: {
          'tab-workbench': {
            templateUrl: 'templates/tab-workbench/workbench.html',
            controller:'workbenchCtrl'
          }
        }
      })

      //我
      .state('tab.person', {
        cache:false,
        url: '/person',
        views: {
          'tab-person': {
            templateUrl: 'templates/tab-person/person.html',
            controller:'personCtrl'
          }
        }
      })

      //注册
      .state("register", {
        cache:false,
        url: '/register',
        templateUrl: 'templates/home/register.html',
        controller:'registerCtrl'
      })

      //登录
      .state("login", {
        url: '/login',
        templateUrl: 'templates/home/login.html',
        controller: 'loginCtrl'
      })

      //忘记密码
      .state("forgetPwd", {
        cache:false,
        url: '/forgetPwd',
        templateUrl: 'templates/home/forgetPwd.html',
        controller:'forgetPwdCtrl'
      })

      //下单
      .state("addOrder", {
        cache:false,
        url: '/addOrder/:companyId/:companyName',
        templateUrl: 'templates/tab-workbench/addOrder/addOrder.html',
        controller: 'AddOrderCtrl'
      })

      //我的订单
      .state("myOrder", {
        cache:false,
        url: '/myOrder',
        templateUrl: 'templates/tab-workbench/myOrder/orderList.html',
        controller: 'OrderListCtrl'
      })

      //修改订单
      .state("changeOrder", {
        cache:false,
        url: '/changeOrder/:id',
        templateUrl: 'templates/tab-workbench/myOrder/changeOrder/changeOrder.html',
        controller: 'ChangeOrderCtrl'
      })

      //查询
      .state('searchTab', {
        url: '/searchTab',
        abstract: true,
        templateUrl: 'templates/tab-workbench/search/searchTabs.html'
      })

      //网点列表
      .state('searchTab.dot', {
        cache:false,
        url: '/dot',
        views: {
          'searchTab-dot': {
            templateUrl: 'templates/tab-workbench/search/searchTab-dot/dot.html',
            controller:'dotCtrl'
          }
        }
      })

      //线路列表
      .state('searchTab.line', {
        cache:false,
        url: '/line',
        views: {
          'searchTab-line': {
            templateUrl: 'templates/tab-workbench/search/searchTab-line/line.html',
            //controller:'receiveCtrl'
          }
        }
      })

      //我的收货
      .state("myReceipt", {
        cache:false,
        url: '/myReceipt',
        templateUrl: 'templates/tab-workbench/myReceipt/receiptList.html',
        controller: 'receiptListCtrl'
      })

      //订单详情
      .state('detailTab', {
        url: '/detailTab/:htmlId',
        abstract: true,
        templateUrl: 'templates/tab-workbench/myOrder/detailTabs.html'
      })

      //详情tab
      .state('detailTab.detail', {
        cache:false,
        url: '/detail',
        views: {
          'detailTab-detail': {
            templateUrl: 'templates/tab-workbench/myOrder/detailTab-detail/orderDetail.html',
            controller:'OrderDetailCtrl'
          }
        }
      })

      //进程tab
      .state('detailTab.process', {
        cache:false,
        url: '/process',
        views: {
          'detailTab-process': {
            templateUrl: 'templates/tab-workbench/myOrder/detailTab-process/orderProcess.html',
            controller:'OrderProcessCtrl'
          }
        }
      })

      //投保
      .state("insurance", {
        cache:false,
        url: '/insurance',
        templateUrl: 'templates/tab-workbench/insurance/insurance.html',
        controller: ''
      })

      //快捷支付
      .state("payment", {
        cache:false,
        url: '/payment',
        templateUrl: 'templates/tab-workbench/payment/payment.html',
        controller: ''
      })

      //收货地址管理
      .state('receiveAddress', {
        cache:false,
        url: '/receiveAddress/:isChoose/:htmlId',
        templateUrl: 'templates/tab-person/receivingAddress/addressList.html',
        controller:'ReceiveAddressCtrl'
      })

      //新增收货地址
      .state('addReceiveAddress', {
        cache:false,
        url: '/addReceiveAddress/:isChoose/:htmlId',
        templateUrl: 'templates/tab-person/receivingAddress/addAddress.html',
        controller:'AddReceiveCtrl'
      })

      //修改收货地址
      .state('changeReceiveAddress', {
        cache:false,
        url: '/changeReceiveAddress/:id/:isChoose/:htmlId',
        templateUrl: 'templates/tab-person/receivingAddress/changeAddress.html',
        controller:'ChangeReceiveCtrl'
      })

      //发货地址管理
      .state('shipperAddress', {
        cache:false,
        url: '/shipperAddress/:isChoose/:htmlId',
        templateUrl: 'templates/tab-person/shippingAddress/addressList.html',
        controller:'ShippingAddressCtrl'
      })

      //新增发货地址
      .state('addShipperAddress', {
        cache:false,
        url: '/addShipperAddress/:isChoose/:htmlId',
        templateUrl: 'templates/tab-person/shippingAddress/addAddress.html',
        controller:'AddShippingCtrl'
      })

      //修改发货地址
      .state('changeShipperAddress', {
        cache:false,
        url: '/changeShipperAddress/:id/:isChoose/:htmlId',
        templateUrl: 'templates/tab-person/shippingAddress/changeAddress.html',
        controller:'ChangeShippingCtrl'
      })

      //修改密码
      .state('changePw', {
        cache:false,
        url: '/changePw',
        templateUrl: 'templates/tab-person/changePw/changePw.html',
        controller:'confirmPwdCtrl'
      })
      .state('newPw', {
        cache:false,
        url: '/newPw',
        templateUrl: 'templates/tab-person/changePw/newPw.html',
        controller:'changePwdCtrl'
      })

      //关于我们
      .state('aboutUs', {
        url: '/aboutUs',
        templateUrl: 'templates/tab-person/aboutUs/aboutUs.html',
        controller:'personCtrl'
      })

      //意见反馈
      .state('feedback', {
        url: '/feedback',
        templateUrl: 'templates/tab-person/feedback/feedback.html',
        controller:'feedbackCtrl'
      })

      //计算器
      .state('calculator', {
        url: '/calculator',
        templateUrl: 'templates/tab-tool/calculator/calculator.html',
        controller:'calculatorCtrl'
      })

      //地图
      .state('gpsMap', {
        cache:false,
        url: '/gpsMap',
        templateUrl: 'templates/tab-tool/GPSMap/gpsMap.html',
        controller:'gpsMapCtrl'
      })

      //备忘录
      .state('note', {
        cache:false,
        url: '/note',
        templateUrl: 'templates/tab-tool/note/note.html',
        controller:'noteCtrl'
      })
      .state('addNote', {
        url: '/addNote/:content/:id',
        templateUrl: 'templates/tab-tool/note/addNote.html',
        controller:'noteCtrl'
      })

      //天气
      .state('weather', {
        url: '/weather/:city',
        templateUrl: 'templates/tab-tool/weather/weather.html',
        controller:'weatherCtrl'
      })

      //工作台-搜索订单
      .state('workbenchSearch', {
        cache:false,
        url: '/workbenchSearch',
        templateUrl: 'templates/tab-workbench/searchOrder.html',
        controller:'workbenchSearchCtrl'
      })

      //工作台-消息
      .state('message', {
        cache:false,
        url: '/message',
        templateUrl: 'templates/tab-workbench/message/message.html',
        controller:'noticeListCtrl'
      })

      //系统消息
      .state('notice', {
        cache:false,
        url: '/notice',
        templateUrl: 'templates/tab-workbench/message/noticeList.html',
        controller:'noticeListCtrl'
      })

      .state('noticeDetail', {
        cache:false,
        url: '/noticeDetail/:title/:content',
        templateUrl: 'templates/tab-workbench/message/noticeDetail.html',
        controller:'noticeListCtrl'
      })
    // if none of the above states are matched, use this as the fallback
    $urlRouterProvider.otherwise('/login');
}])
;
